﻿// JScript File
function PerformClick(e, target) 
{
    if (e.which || e.keyCode)
    {
        if ((e.which == 13) || (e.keyCode == 13))
        {
            document.getElementById(target).click();
            return false;
        }
    }
    else
    {
        return true;
    } 
}

// JScript File

function CheckAll(objName,checked)
{
    for (var i=0;i<document.forms[0].elements.length;i++)
    {
        var e = document.forms[0].elements[i];
        if (e.name == objName)
	        e.checked = checked;
    }
}
//  ---------------------------------------

function SelectedAll(objName)
{
    for (var i=0;i<document.forms[0].elements.length;i++)
    {
        var e = document.forms[0].elements[i];
        if (e.name == objName)
	        if(!e.checked)
	            return false;	      
    }
    
    return true;
}
//  ---------------------------------------

function Item_Select(obj, Lobj)
{
        var objTemp = document.getElementById(obj);        
        if(objTemp)
            objTemp.checked = SelectedAll(Lobj);
}
//  ---------------------------------------

function ConfirmOption(msgEmty, msgQuestion)
{
  if( ! Chk_BeforeDelete(msgEmty))
  return false;
  return confirm(msgQuestion);
}

//  ---------------------------------------

function Chk_BeforeDelete(msgEmty)
{
  for (var i = 0; i < document.forms[0].elements.length; i ++ )
  {
    var e = document.forms[0].elements[i];
    if (e.name == 'iptSelect')
    if(e.checked)
    return true;
  }
  alert(msgEmty);
  return false;
}